package com.designpatterns.factory.factory3.pizza.pizzaimp;

import com.designpatterns.factory.factory3.factory.PizzaIngredientFactory;
import com.designpatterns.factory.factory3.pizza.BasePizza;

/**
 * @author Brook
 */
public class PepperoniBasePizza extends BasePizza {
    PizzaIngredientFactory pizzaIngredientFactory;

    public PepperoniBasePizza(PizzaIngredientFactory pizzaIngredientFactory) {
        this.pizzaIngredientFactory = pizzaIngredientFactory;
    }

    @Override
    public void prepare() {
        System.out.println("Preparing...." + name);
        dough = pizzaIngredientFactory.createDough();
        sauce = pizzaIngredientFactory.createSauce();
        pepperoni = pizzaIngredientFactory.createPepperoni();
    }
}
